package com.sq.partner.manager.dao.impl;

import com.sq.partner.manager.dao.BaseDao;
import com.sq.partner.manager.dao.CarAccidentDao;
import com.sq.partner.manager.dao.ICoreDeptDao;
import com.sq.partner.manager.mybatis.model.TradConfig;
import com.sq.partner.manager.util.LogUtil;
import org.apache.ibatis.annotations.Param;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 2022/9/14 20:22
 */
@Repository
public class carAccidentDaoImpl  extends BaseDaoImpl implements CarAccidentDao{
	private static Logger logger = LogUtil.getLog(IGatewayAgentInfoMtDaoImpl.class);

	@Override
	public List<Map<String, Object>> queryConfigPlanByCriteria(Map<String, Object> map) throws SQLException {
		List<Map<String, Object>> list = this.queryList("queryConfigPlanByCriteria", map);
		return list;
	}

	@Override
	public Integer queryConfigPlanCount(Map<String, Object> map) throws SQLException {
		Integer count = (Integer) this.query("queryConfigPlanCount",map);
		return count;
	}

	@Override
	public Boolean updateConfigPlanList(List<TradConfig> configArrayList) throws Exception {
		Boolean flag = false;
		try {
			this.batchUpdate("updateConfigPlanList",configArrayList);
			flag = true;
		}catch (Exception e){
			flag = false;
			logger.error(e);
		}
		//boolean flag = this.update("updateConfigPlanList", configArrayList);
		return flag;
	}
}
